<?php
// +----------------------------------------------------------------------
// | ManniuRead
// +----------------------------------------------------------------------
// | Copyright (c) 2006~2016 http://manniuyun.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: heitao <read@manniuyun.com>
// +----------------------------------------------------------------------

namespace app\member\model;

use manniu\model\Base;
use think\Cache;

class MemberGroup extends Base
{
    /**
     * 查询单个会员组
     * @param $group_id
     * @return null|static
     */
    public static function getGroup($group_id){
        $group = self::get($group_id);
        return $group;
    }

    /**
     * 查询所有会员组
     * @return array
     */
    public static function getGroupAll(){
        $groups = [];
        $result = self::all();
        if($result){
            foreach ($result as $key => $group){
                $groups[$group->getData('id')] = $group;
            }
        }
        return $groups;
    }
}